/**
 * @param {number} num
 * @return {string}
*/
var toHex = function(num) {
  if(num < 0) {
    num = 2 ** (32) + num;
  }
  return num.toString(16);
};
let num = 26;
console.log(toHex(num));
num = -1;
console.log(toHex(num));
num = -2;
console.log(toHex(num));
